﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Add.aspx.cs" Inherits="Admin.Finance.SubInvoice.Add" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
     <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
     <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> 
     <META HTTP-EQUIV="Expires" CONTENT="0"> 
    <link href="/Themes/Default/Css/Style.css" rel="stylesheet" type="text/css" />
    <link href="/Components/EasyUI/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="/Components/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="/Jscript/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="/Components/EasyUI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="/Jscript/midsoft.js" type="text/javascript"></script>
    <script src="/Jscript/PopWindow.js" type="text/javascript"></script>
    <script src="/Jscript/CheckBox.js" type="text/javascript"></script>
    <script type="text/javascript">
        function CheckMaxMoney(conn) {
            if ($(conn).val() * 1 > $("#lblMaxMoney").html() * 1) {
                $(conn).val($("#lblMaxMoney").html());
            }
        };
    </script>
    <title>收票管理</title>
</head>
<body>
    <form id="form1" runat="server">
     <table style="width: 100%;" cellpadding="2" cellspacing="1" border="0">
        <tr>
            <td>
                <table cellspacing="0" cellpadding="0" width="100%" border="1" bordercolordark="white"
                    bordercolorlight="#b7c9e9" style="padding-left: 3px">
                    <tr>
                        <td height="25" align="right" style="width: 85px">
                            项目编号 ：
                        </td>
                        <td height="25" width="*" align="left" style="width: 335px">
                            <asp:Label ID="lblProjectNumber" runat="server" Text=""></asp:Label>
                        </td>
                        <td height="25" align="right" style="width: 85px">
                            项目名称 ：
                        </td>
                        <td height="25" width="*" align="left" style="width: 330px">
                            <asp:Label ID="lblProjectName" runat="server" Text=""></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right" style="width: 85px">
                            合同编号 ：
                        </td>
                        <td height="25" width="*" align="left" style="width: 335px">
                            <asp:Label ID="lblContractNumber" runat="server" Text=""></asp:Label>
                        </td>
                        <td height="25" align="right" style="width: 85px">
                            合同名称 ：
                        </td>
                        <td height="25" width="*" align="left" style="width: 330px">
                            <asp:Label ID="lblContractName" runat="server" Text=""></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right" style="width: 85px">
                            合同金额 ：
                        </td>
                        <td height="25" width="*" align="left">
                            <asp:Label ID="lblContractMoney" runat="server" Text=""></asp:Label>
                         </td>
                        <td height="25" align="right" style="width: 85px">
                            开票人 ：
                        </td>
                        <td height="25" width="*" align="left">
                            <asp:TextBox ID="txtCreateUser" runat="server" Width="200px"></asp:TextBox>
                         </td>
                    </tr>
                    <tr>
                        <td height="25" align="right" style="width: 85px">
                            发票编号 ：
                        </td>
                        <td height="25" width="*" align="left">
                            <asp:TextBox ID="txtInvoiceNumber" runat="server" Width="200px"></asp:TextBox>
                         </td>
                        <td height="25" align="right" style="width: 85px">
                            客户名称 ：
                        </td>
                        <td height="25" width="*" align="left" style="width: 330px">
                            <asp:TextBox ID="txtCustomer" runat="server" Width="200px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right" style="width: 85px">
                            领票人 ： 
                        </td>
                        <td height="25" width="*" align="left" style="width: 330px">
                            <asp:TextBox ID="txtReceiveMan" runat="server" Width="200px"></asp:TextBox>
                        </td>
                        <td height="25" align="right" style="width: 85px">
                            开票部门 ：
                        </td>
                        <td height="25" width="*" align="left" style="width: 330px">
                            <asp:DropDownList ID="ddlDeparMent" runat="server" Width="200px">
                                <asp:ListItem></asp:ListItem>
                                <asp:ListItem>程序部</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" align="right" style="width: 85px">
                            收票金额 ：
                        </td>
                        <td height="25" width="*" align="left">
                        <input id="txtInvoiceMoney" type="text" runat="server" style="width:200px" onblur='javascript:CheckMaxMoney(this)'  onfocus="javascript:CheckMaxMoney(this)"   />
                            (可填最大值：<asp:Label ID="lblMaxMoney" runat="server"></asp:Label>)
                            <input id="hiddenContractMoney" type="hidden" runat="server" />
                        </td>
                        <td height="25" align="right" style="width: 85px">
                            收票日期 ：
                        </td>
                        <td height="25" width="*" align="left">
                            <input id="txtInvoiceDate" class="Wdate" type="text" onclick="WdatePicker()" runat="server" readonly="readonly" style="width:200px;" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="tdbg" align="center" valign="bottom">
                <asp:Button ID="btnSave" runat="server" Text="保存"
                    OnClick="btnSave_Click" class="inputbutton" onmouseover="this.className='inputbutton_hover'"
                    onmouseout="this.className='inputbutton'"></asp:Button>
                <input type="button" value="关闭"  class="inputbutton" onmouseover="this.className='inputbutton_hover'"
                    onmouseout="this.className='inputbutton'" onclick="javascript:window.parent.$('#DivSysiframe').dialog('close');window.parent.$('#Div1').dialog('close');"/>
                <asp:HiddenField ID="hiddenProjectId" runat="server" />
                <asp:HiddenField ID="hiddenContractId" runat="server" />
            </td>
        </tr>
    </table>

    <table style="width: 100%;" cellpadding="2" cellspacing="0" class="workspacesearch">
        <tr>
            <td class="dt" align="center">
                查询条件
            </td>
            <td style="width: 70px" align="center" class="tdbg">
                <b>发票编号：</b>
            </td>
            <td class="tdbg">
                <asp:TextBox ID="txtStartNumberSearch" runat="server"></asp:TextBox>
                -<asp:TextBox ID="txtEndNumberSearch" runat="server"></asp:TextBox>
            </td>
            <td style="width: 70px" align="center" class="tdbg">
                <b>客户单位：</b>
            </td>
            <td class="tdbg">
                <asp:TextBox ID="txtCustomerSearch" runat="server"></asp:TextBox>
            </td>
            <td class="tdbg">
                <asp:ImageButton ID="imgBtnSearch" ImageUrl="/Themes/TheOne/images/btn_search.gif"
                    runat="server" OnClick="btnSearch_Click" />
            </td>
        </tr>
    </table>

    <table width="100%" cellpadding="0" cellspacing="0" border="0" class="formList" >
        <tr>
            <td>
                <!--Search end-->
                <table height="220px" border="0" width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td valign="top" height="200px">
                            <asp:GridView ID="gridView" runat="server" AllowPaging="True" Width="100%" CellPadding="4"
                                OnPageIndexChanging="gridView_PageIndexChanging" DataKeyNames="SubInvoiceId" OnRowDataBound="gridView_RowDataBound"
                                AutoGenerateColumns="False" RowStyle-HorizontalAlign="Center" OnRowCreated="gridView_OnRowCreated"
                                ForeColor="#333333" OnRowDeleting="gridView_RowDeleting">
                                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                <Columns>
                                    <asp:TemplateField ControlStyle-Width="30" HeaderText="选择" Visible="false">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="checkboxname" name="checkboxname" onclick="javascript:SingleCheckJs();"
                                                runat="server" />
                                        </ItemTemplate>
                                        <ControlStyle Width="30px"></ControlStyle>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="项目编号">
                                        <ItemTemplate>
                                                <%#Eval("ProjectNumber")%>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="合同编号">
                                        <ItemTemplate>
                                                <%#Eval("ContractNumber")%>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="发票编号">
                                        <ItemTemplate>
                                            <a href="/Finance/SubInvoice/Add.aspx?id=<%#Eval("SubInvoiceId") %>&&ContractId=<%#Eval("ContractId") %>">
                                                <%#Eval("InvoiceNumber")%></a>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="Customer" HeaderText="客户单位" ItemStyle-HorizontalAlign="Center">
                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ReceiveMan" HeaderText="领票人" SortExpression="ReceiveMan"
                                        ItemStyle-HorizontalAlign="Center">
                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="InvoiceMoney" HeaderText="收票金额" SortExpression="InvoiceMoney" ItemStyle-HorizontalAlign="Center">
                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="CreateUser" HeaderText="开票人" SortExpression="CreateUser" ItemStyle-HorizontalAlign="Center">
                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="CreateDepartment" HeaderText="开票部门" SortExpression="CreateDepartment" ItemStyle-HorizontalAlign="Center">
                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="InvoiceDate" HeaderText="收票时间" SortExpression="InvoiceDate"
                                        ItemStyle-HorizontalAlign="Center" DataFormatString="{0:yyyy-MM-dd}">
                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:TemplateField ControlStyle-Width="50" HeaderText="删除">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                                                Text="删除" OnClientClick="return confirm('确认删除吗？');"></asp:LinkButton>
                                        </ItemTemplate>
                                        <ControlStyle Width="50px"></ControlStyle>
                                    </asp:TemplateField>
                                </Columns>
                                <EditRowStyle BackColor="#999999" />
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#598cbf" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle HorizontalAlign="Center" BackColor="#F7F6F3" ForeColor="#333333"></RowStyle>
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                            </asp:GridView>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" CssClass=""
                                FirstPageText="首页" HorizontalAlign="Right" LastPageText="末页" NextPageText="下一页"
                                PageIndexBoxType="TextBox" PrevPageText="上一页" ShowCustomInfoSection="Left" ShowInputBox="Always"
                                ShowPageIndexBox="Always" OnPageChanged="AspNetPager1_PageChanged" PageSize=6>
                            </webdiyer:AspNetPager>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
